#include <iostream>
#include <Windows.h>
#include <Winnt.h>
#include <tlhelp32.h>
using namespace std;

HANDLE HandleProcess ();

int main()
{
    char value[500];
    DWORD addr = 0x02DD9CC8;
    ReadProcessMemory(HandleProcess(), (LPCVOID)addr, &value, sizeof(value), 0) ;
    cout<<endl<<value;
    return 0;
}

HANDLE HandleProcess () {

    PROCESSENTRY32 pe32;
    HANDLE		         hSnapshot = NULL;

    pe32.dwSize = sizeof( PROCESSENTRY32 );
    hSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );

    if( Process32First( hSnapshot, &pe32 ) )
    {
        do{
            cout<<pe32.th32ProcessID<<" ";
            if( wcscmp( pe32.szExeFile, L"adroit.exe" ) == 0 )
                break;
        }while( Process32Next( hSnapshot, &pe32 ) );
    }
    CloseHandle( hSnapshot );
    cout<<endl;
    cout<<pe32.th32ProcessID<<" ";

    HANDLE hProcess;
    hProcess = OpenProcess(PROCESS_VM_READ, 0, pe32.th32ProcessID);
   // cout<<hProcess;
    return hProcess;


}
